# Maintainer: Luca Weiss <luca@lucaweiss.eu>
pkgname=py3-isodate
_pyname=isodate
pkgver=0.7.2
pkgrel=0
pkgdesc="An ISO 8601 date/time/duration parser and formatter"
url="https://pypi.org/project/isodate"
arch="noarch"
license="BSD-3-Clause"
checkdepends="py3-pytest"
makedepends="py3-gpep517 py3-setuptools py3-setuptools_scm py3-wheel"
_pypiprefix="${_pyname%${_pyname#?}}"
subpackages="$pkgname-pyc"
source="https://files.pythonhosted.org/packages/source/$_pypiprefix/$_pyname/$_pyname-$pkgver.tar.gz"
builddir="$srcdir/$_pyname-$pkgver"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2

}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m pytest
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
6361ff91b797c1b925de3c97d53b3d521534f2d81a87b724f32da83238b8458feccf3805971e6b4e1986440b6bb9c47cb707499d340de79214dfc135336f9235  isodate-0.7.2.tar.gz
"
